import { http } from "@/utils/http";
import { baseUrlApi, type Result, type ListResult } from "@/utils/apiPublic";
import { BaseApi } from "../base";

/** 列表 */
export const getDeptList = (data?: object) => {
  return http.request<ListResult>("post", baseUrlApi("admin/dept/list"), {
    data
  });
};
/** 新增/更新 */
export const deptSave = (data?: object) => {
  return http.request<Result>("post", baseUrlApi("admin/dept/save"), {
    data
  });
};
/** 删除 */
export const deptDelete = (data?: object) => {
  return http.request<Result>("post", baseUrlApi("admin/dept/delete"), {
    data
  });
};

export const deptApi = new BaseApi('admin/dept');
